﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;

namespace decode
{
    static class Program
    {

        public static List<Cl_dico> dicos { get; set; }
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            chargerDicos();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }


        //chargement des dicos
        private static void chargerDicos()
        {
            Debug.WriteLine("Chargment des dicos");

            
            dicos = new List<Cl_dico>(0);
            string sPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\dico";
            foreach (string sFileName in Directory.GetFiles(sPath))
            {
                if (Path.GetExtension(sFileName) == ".txt")
                {
                    Debug.WriteLine("Chargment des dicos" + sFileName);
                    dicos.Add(new Cl_dico(sFileName));
                }
            }

            Debug.WriteLine("Fin Chargment des dicos");
        }
    }
}
